<?php
/**
 * 单例模式----设计模式
 * Created by Jason.
 * User: Administrator
 * Date: 2019/12/7 0007
 * Time: 下午 2:23
 */
namespace app\index\service;

final class Single
{
    private static $instance;

    private function __construct(){}

    private function __clone(){}

    public static function getInstance(){
        if(static::$instance === null){
            static::$instance = new static();
        }
        return static::$instance;
    }

    public function say(){
        echo 'You get it! instance';
    }
}